﻿
Option Compare Binary
Option Infer On
Option Strict On
Option Explicit On

Imports SilverlightSEO.Data
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations
Imports System.Data.Linq
Imports System.Linq
Imports System.Web.DomainServices
Imports System.Web.DomainServices.Providers
Imports System.Web.Ria
Imports System.Web.Ria.Services



Partial Public Class SiteDomainService
    Inherits LinqToSqlDomainService(Of SiteDataClassesDataContext)

    Public Function GetAspnet_Profiles() As IQueryable(Of aspnet_Profile)
        Return Me.DataContext.aspnet_Profiles
    End Function

    Public Sub InsertAspnet_Profile(ByVal aspnet_Profile As aspnet_Profile)
        Me.DataContext.aspnet_Profiles.InsertOnSubmit(aspnet_Profile)
    End Sub

    Public Sub UpdateAspnet_Profile(ByVal currentaspnet_Profile As aspnet_Profile)
        Me.DataContext.aspnet_Profiles.Attach(currentaspnet_Profile, Me.ChangeSet.GetOriginal(currentaspnet_Profile))
    End Sub

    Public Sub DeleteAspnet_Profile(ByVal aspnet_Profile As aspnet_Profile)
        Me.DataContext.aspnet_Profiles.Attach(aspnet_Profile)
        Me.DataContext.aspnet_Profiles.DeleteOnSubmit(aspnet_Profile)
    End Sub

    'TODO: Consider
    ' 1. Adding parameters to this method and constraining returned results, and/or
    ' 2. Adding query methods taking different parameters.
    Public Function GetAspnet_Users() As IQueryable(Of aspnet_User)
        Return Me.DataContext.aspnet_Users
    End Function

    Public Sub InsertAspnet_User(ByVal aspnet_User As aspnet_User)
        Me.DataContext.aspnet_Users.InsertOnSubmit(aspnet_User)
    End Sub

    Public Sub UpdateAspnet_User(ByVal currentaspnet_User As aspnet_User)
        Me.DataContext.aspnet_Users.Attach(currentaspnet_User, Me.ChangeSet.GetOriginal(currentaspnet_User))
    End Sub

    Public Sub DeleteAspnet_User(ByVal aspnet_User As aspnet_User)
        Me.DataContext.aspnet_Users.Attach(aspnet_User)
        Me.DataContext.aspnet_Users.DeleteOnSubmit(aspnet_User)
    End Sub
End Class

